package com.oak.designmode._13_builderPattern;

/**
 * 建造者模式
 *
 * @Description
 * @Author guoxy
 * @Date 2020/3/18
 * @Version 1.0
 */
public class Test {

    public static void main(String[] args) {

        // 指导类
        ComputerDirector director = new ComputerDirector();

        // 构建者-具体构建者
        ComputerBuilder builder = new MacComputerBuilder("I5处理器", "三星125");
        // 构建产品过程
        director.makeComputer(builder);
        // 产品
        Computer macComputer = builder.getComputer();
        System.out.println("mac computer:" + macComputer.toString());


        ComputerBuilder lenovoBuilder = new LenovoComputerBuilder("I7处理器", "海力士222");
        director.makeComputer(lenovoBuilder);
        Computer lenovoComputer = lenovoBuilder.getComputer();
        System.out.println("lenovo computer:" + lenovoComputer.toString());
    }
}